const express = require('express');
// 导入验证数据合法性的中间件
const expressJoi = require('@escook/express-joi')
const { update_userinfo_schema, update_password_schema } = require('../schema/user')
    // 导入用户信息的处理模块
const userinfo_handler = require('../router_handler/userinfo');


const router = express.Router();

// 获取用户信息
router.get('/userinfo', userinfo_handler.getUserInfo);

// 更新用户信息
router.post('/userinfo', expressJoi(update_userinfo_schema), userinfo_handler.updateUserInfo);

// 更新密码
router.post('/updatePwd', expressJoi(update_password_schema), userinfo_handler.updatePassword);


module.exports = router;